#pragma once



#include <iostream>
#include <string>
#include <fstream>
#include <map>
#include <vector>
#include <list>
#include <sstream>

#include <malloc.h>
#include <stdio.h>
#include <string.h>

using namespace std;

	// Exception ----
	class ParserException{
	protected:
		string themsg;
	public:
		unsigned int line;
		ParserException() {}
		ParserException(const char* expecting, string got, unsigned int line){
			this->line = line;
			stringstream msg;
			msg << "Parser exception: Expecting \"" <<
				expecting << "\", got \"" << got << "\"";

			themsg = msg.str();
		}

		ParserException( const char* message, string extra){
			themsg = message;
			themsg += " ";
			themsg += extra;
		}

		ParserException( string what ){
			themsg = what;
		}

		virtual const char* what() const throw() {
			return themsg.c_str();
		}
	} ;

	class SymbolException : public ParserException {
	public:
		SymbolException(){}
		SymbolException( string symbolName, const char* status, unsigned int line ){
			this->line = line;
			stringstream msg;
			msg << symbolName << " " << status;
			themsg = msg.str();
		}
	};

	class ConversionException : public ParserException {
	public:
		ConversionException() {}
		ConversionException(const string& type1, const string& type2, unsigned int line ){
			this->line = line;
			stringstream msg;
			msg << "Conversion exception: Could not convert between "
				<< type1 << " and " << type2;
			themsg = msg.str();
		};
	};



#include "Token.h"

#include "Type.h"
#include "SyntaxTree.h"

#include "Lexer.h"
#include "SymbolTable.h"
#include "Parser.h"



